export default {
	setModelDataOffset(state, payload = {}) {
		let {
			model,
			affected_rows = false,
			returning = false,
			raw_data = false,
			data = false,
			data_list = false,
			data_other = false,
			count = false,
			isrefresh = true
		} = payload
		if (!state[model]?.model) {
			state[model] = {
				model,
				raw_data,
				data: {},
				data_list: [],
				data_other:{},
				count: 0,
				affected_rows: 0,
				returning: []
			}
		}
		affected_rows !== false && (state[model].affected_rows = affected_rows)
		returning !== false && (state[model].returning = returning)
		if (!isrefresh) {
			data !== false && (deepMerge(state[model].data, data))
		} else {
			data !== false && (state[model].data = data)
		}
		data_list !== false && (state[model].data_list = data_list)
		data_other !== false && (state[model].data_other = data_other)
		count !== false && (state[model].count = count)
		count !== false && (state[model].raw_data = raw_data)
	},
}
